# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.VMwareEngine.V1.Model.PrivateConnection do
  @moduledoc """
  Private connection resource that provides connectivity for VMware Engine private clouds.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Creation time of this resource.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. User-provided description for this private connection.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name of the private connection. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: `projects/my-project/locations/us-central1/privateConnections/my-connection`
  *   `peeringId` (*type:* `String.t`, *default:* `nil`) - Output only. VPC network peering id between given network VPC and VMwareEngineNetwork.
  *   `peeringState` (*type:* `String.t`, *default:* `nil`) - Output only. Peering state between service network and VMware Engine network.
  *   `routingMode` (*type:* `String.t`, *default:* `nil`) - Optional. Routing Mode. Default value is set to GLOBAL. For type = PRIVATE_SERVICE_ACCESS, this field can be set to GLOBAL or REGIONAL, for other types only GLOBAL is supported.
  *   `serviceNetwork` (*type:* `String.t`, *default:* `nil`) - Required. Service network to create private connection. Specify the name in the following form: `projects/{project}/global/networks/{network_id}` For type = PRIVATE_SERVICE_ACCESS, this field represents servicenetworking VPC, e.g. projects/project-tp/global/networks/servicenetworking. For type = NETAPP_CLOUD_VOLUME, this field represents NetApp service VPC, e.g. projects/project-tp/global/networks/netapp-tenant-vpc. For type = DELL_POWERSCALE, this field represent Dell service VPC, e.g. projects/project-tp/global/networks/dell-tenant-vpc. For type= THIRD_PARTY_SERVICE, this field could represent a consumer VPC or any other producer VPC to which the VMware Engine Network needs to be connected, e.g. projects/project/global/networks/vpc.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. State of the private connection.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Required. Private connection type.
  *   `uid` (*type:* `String.t`, *default:* `nil`) - Output only. System-generated unique identifier for the resource.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Last update time of this resource.
  *   `vmwareEngineNetwork` (*type:* `String.t`, *default:* `nil`) - Required. The relative resource name of Legacy VMware Engine network. Specify the name in the following form: `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` where `{project}`, `{location}` will be same as specified in private connection resource name and `{vmware_engine_network_id}` will be in the form of `{location}`-default e.g. projects/project/locations/us-central1/vmwareEngineNetworks/us-central1-default.
  *   `vmwareEngineNetworkCanonical` (*type:* `String.t`, *default:* `nil`) - Output only. The canonical name of the VMware Engine network in the form: `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :description => String.t() | nil,
          :name => String.t() | nil,
          :peeringId => String.t() | nil,
          :peeringState => String.t() | nil,
          :routingMode => String.t() | nil,
          :serviceNetwork => String.t() | nil,
          :state => String.t() | nil,
          :type => String.t() | nil,
          :uid => String.t() | nil,
          :updateTime => DateTime.t() | nil,
          :vmwareEngineNetwork => String.t() | nil,
          :vmwareEngineNetworkCanonical => String.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:description)
  field(:name)
  field(:peeringId)
  field(:peeringState)
  field(:routingMode)
  field(:serviceNetwork)
  field(:state)
  field(:type)
  field(:uid)
  field(:updateTime, as: DateTime)
  field(:vmwareEngineNetwork)
  field(:vmwareEngineNetworkCanonical)
end

defimpl Poison.Decoder, for: GoogleApi.VMwareEngine.V1.Model.PrivateConnection do
  def decode(value, options) do
    GoogleApi.VMwareEngine.V1.Model.PrivateConnection.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.VMwareEngine.V1.Model.PrivateConnection do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
